﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Zhao.Arena.Utility.SwaggerExt;
using Zhao.Common.Helper;
using Zhao.IServer;
using Zhao.Models.DTO;
using Zhao.Service;

namespace Zhao.Arena.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    [ApiExplorerSettings(IgnoreApi = false, GroupName = nameof(ApiVersions.V1))]
    public class AreaServerController : ControllerBase
    {
        private readonly IAreaServer _areaServer;

        public AreaServerController(IAreaServer areaServer)
        {
            _areaServer = areaServer;
        }

        [HttpGet]
        public  JsonResult GetAreaPage()
        {
            return new JsonResult(new ApiResult<List<AreaDto> >{Success=true,Data= _areaServer.GetAreas() });
        }
    }
}
